package com.imu.purse.modules.trade.entity;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import com.imu.core.base.BaseEntity;
import com.imu.common.validator.group.UpdateGroup;


/**
 * IMU转账日志表
 * 
 * @author sunhongwei
 * @email sunhongwei@jshijian.com
 * @date 2018-07-01 16:21:08
 * Copyright (c) 2017 武汉极时间科技有限公司 版权所有 
 * Jshijian aloha CO.,LTD. All Rights Reserved. 
 */
@Data
@Table(name = "imu_trans_log")
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class TransLogEntity extends BaseEntity
{
	private static final long serialVersionUID = 1L;
	
	//主键ID
	@Id
	@Column(name="id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@NotNull(message="主键不存在无法更新", groups = {UpdateGroup.class})
	private Long id;
	
	//用户ID A1的用户ID
	@Column(name="user_id")
	private Long userId;
	
	//订单状态0:初始化,1:手续费转换完成,2:token扣除,3:token完成
	@Column(name="order_state")
	private Integer orderState;
	
	//订单号
	@Column(name="order_no")
	private String orderNo;
	
	//交易ID A-A1手续费
	@Column(name="trans_id")
	private String transId;

	//交易金额
	@Column(name="money")
	private BigDecimal money;

	//创建时间
	@Column(name="create_time")
	private Date createTime;
	
	//更新时间
	@Column(name="update_time")
	private Date updateTime;

	@Transient
	private Long transTime;
}
